package com.zmn.plat.model.entity.orderconfig.orderstock.channel;

import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

import com.zmn.common.utils.date.DateUtil;

import lombok.Data;


/**
 * 描述: 渠道库存页面显示VO
 *
 * @author xiangjunming
 * @since 2020-03-17 10:29:08
 **/
@Data
public class ChannelConfigClosePageVO extends ChannelConfigClose {

    /**
     * 描述: 关闭日期
     **/
    private List<Date> closeDays;

    public String getCloseDaysStr() {
        String closeDaysStr = "-";
        if (closeDays != null && !closeDays.isEmpty()) {
            closeDaysStr = closeDays.stream().map(item -> DateUtil.toString(item, "MM-dd")).collect(Collectors.joining(","));
        }
        return closeDaysStr;
    }

    public String getCloseDayStr() {
        String closeDayStr = null;
        if (getDay() != null) {
            closeDayStr = DateUtil.toString(getDay(), "MM-dd");
        }
        return closeDayStr;
    }

}
